home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2005 Utilities / CHIP Utilities 2005.7z / CHIP Utilities 2005.iso / docs / trinux / trinux.sourceforge.net / docs.txt < prev    next >
Encoding:
Text File  |  2003-08-08  |  10.4 KB  |  322 lines

  1. Trinux Documentation                     Matthew Franz <mfranz@cisco.com>
  2. http://trinux.sf.net/docs.txt            27 July 2003 
  3.  
  4. 0. Introduction
  5.  
  6.     0.1 What is Trinux?
  7.  
  8.         Trinux is a ramdisk-based Linux    distribution that was first
  9.         released in April of 1998 and has been maintained on and off
  10.         since then. Like other Linux distributions it consists of a 
  11.         Linux kernel, base utilities, and a variety of packages. Like
  12.         many embedded distributions, Trinux uses Busybox, which contains
  13.         small versions of common utilities. See http://www.busybox.net.
  14.  
  15.     0.2 Where can I get the source?
  16.  
  17.         Many of the standard utilities came from Slackware 7.1 or
  18.         when components needed to be upgraded, I pulled the source
  19.         from the Debian stable. The "original code" would be in the
  20.         /linuxrc script that is executed within
  21.  
  22.     0.3 Installation
  23.  
  24.         Trinux is released in either 1.4 meg floppy images or small ISO
  25.         images. For the floppy images use dd on unix boxes or rawrite
  26.         on Windows. Search the web for info.
  27.  
  28.     0.4 If in doubt look at the /linuxrc script!
  29.  
  30. 1. Boot Media
  31.  
  32.     1.1 Common Format
  33.  
  34.         * bzImage - compressed linux kernel
  35.         * tux - trinux configuration directory (like /etc on Unix) that
  36.           gets copied to /etc/tux when trinux boots
  37.         * bootpkg - packages that need to be loaded early
  38.         * kpkg - modular kernel packages
  39.         * initrd.gz - compressed initial ramdisk
  40.         * modules - raw (*.o) modules will be automatically loaded
  41.  
  42.     1.2 Floppy Disks
  43.  
  44.         Trinux uses MS-DOS (vfat actually) formatted disks and syslinux
  45.         as the bootloader. The files/directories described in 1.1 are 
  46.         directly off the root of the drive.
  47.  
  48.         * syslinux.cfg - bootloader configuration file
  49.         * ldlinux.sys - SYSLINUX bootloader (http://syslinux.zytor.com/)
  50.  
  51.     1.3 CD-ROM
  52.  
  53.         Bootable CD's are ISO9660 filesytem contain 2 directories:
  54.         * isolinux - bzImage, initrd.gz, isolinux.bin, isolinux.cfg
  55.         * trinux - bootpkg, kpkg, modules, tux
  56.  
  57.     1.4 Fixed Partition (IDE Drive)
  58.  
  59.         Trinux can also be booted from a Windows 95/98, MS-DOS, or
  60.         FreeDOS partition using loadlin.exe. This is an option for older
  61.         hardware that might not have a CD-ROM (or a bootable one) or
  62.         if you want to load packages from a compact Flash drive using an
  63.         IDE Compact-Flash Adapter.
  64.  
  65.         1.4.1 Prepping the Drive
  66.  
  67.             Use a Windows 95/98 or MS-DOS boot disk or the Trinux FreeDOS
  68.             Utility Disk (available on the downloads page) to create a FAT 32
  69.             partition. This involves running FDISK, FORMAT, and SYS. You
  70.             should copy loadlin.exe to the drive and it is also useful to have
  71.             a text editor (FreeDOS has TE) to edit batch files. You will 
  72.             need to create trinux directory. My C:\ drive (mounted from
  73.             within Trinux as a vfat) looks like this:
  74.  
  75.             trinux> ls -al
  76.             root     root        16384 Jul 24 23:28 .
  77.             root     root          832 Sep  3  2002 ..
  78.             root     root         2048 Jul 20 18:51 .links
  79.             root     root           50 Jul 20 17:35 autoexec.bat
  80.             root     root       618999 Jul 20 18:11 bzimage
  81.             root     root        86561 Aug 15  2001 command.com
  82.             root     root        45836 Jul 20 17:35 fdisk.exe
  83.             root     root        13741 Jul 20 17:35 format.exe
  84.             root     root       600357 Jul 21 01:01 initrd.gz
  85.             root     root        75663 Sep  3  2001 kernel.sys
  86.             root     root        32177 Jul 20 17:35 loadlin.exe
  87.             root     root        32719 Jul 20 17:35 loadlin.txt
  88.             root     root         2048 Jul 20 18:33 old
  89.             root     root         8634 Jul 20 17:36 sys.com
  90.             root     root        44706 Jul 20 17:35 te.exe
  91.             root     root         2048 Jul 21 12:31 trinux
  92.  
  93.             TRINUX.BAT on the FreeDOS boot floppy contains the following
  94.             which I renamed to AUTOEXEC.BAT once I new it was stable.
  95.  
  96.                 loadlin bzimage initrd=initrd.gz root=/dev/ram0 rw
  97.  
  98.             Copy a kernel that has IDE support (all the kernels on the
  99.             boot floppies after Trinux 0.90 should have the or a kernel
  100.             from the CD-ROM will work to) and an initrd.gz to the c:\
  101.             drive. You can do this from DOS or from Linux.
  102.  
  103.         1.4.2 Copying necessary files to the DOS partition
  104.  
  105.             Boot with a Trinux floppy (or CD-ROM) that has IDE support
  106.             and then mount the MS-DOS partition with the following 
  107.             command
  108.             
  109.                 # mount -t vfat /dev/hda1 /mnt
  110.  
  111.             This assumes the first IDE drive and should work for most
  112.             cases. Now create (or cd) the trinux directory on that 
  113.             partition and create the subdirectories for packages
  114.  
  115.                 # cd /mnt/trinux
  116.                 # mkdir bootpkg kpkg pkg modules
  117.                 # mkdir -p tux/config
  118.                 # mkdir tux/
  119.  
  120.             Now you need to get a minimum set of packages into the bootpkg
  121.             directory. If you have network access you can download them with
  122.             links (getpkg links) or you can copy them to floppies. I have
  123.             the following in mine:
  124.  
  125.             root     root       245776 Jul 20 19:17 baselib.tgz
  126.             root     root        15932 Jul 20 18:17 dhcpcd.tgz
  127.             root     root        90312 Jul 20 18:17 dnslibs.tgz
  128.             root     root       163951 Jul 21 12:28 iptables.tgz
  129.             root     root       131200 Jul 21 12:28 netfilter.tgz
  130.             root     root        77834 Jul 20 19:22 pthread.tgz
  131.             root     root       378444 Jul 20 19:22 term.tgz
  132.  
  133.             These will always get loaded. You can also put packages in the
  134.             pkg directory and these may/may not load depending on your
  135.             configuration.
  136.  
  137.             Remember, after you are through modifying the partition, it
  138.             needs to be unmounted with:
  139.  
  140.             #umount /dev/hda1  
  141.                 or
  142.             #umount /mnt
  143.             
  144.         1.4.3 Configuarition
  145.  
  146.  
  147. 2. Networking
  148.  
  149.     2.1 Hardware Detection
  150.  
  151.         In order for you to use networking your interface(s) must be
  152.         detected by the kernel. In order for this to occur you must either
  153.         have support for your NIC compiled into the kernel or use a kernel
  154.         module. Older versions of Trinux had support for the most common
  155.         NiCs built in, but that is no longer the case.
  156.  
  157.         If your hardware was succuessfully found
  158.  
  159.         # dmesg | grep eth0
  160.         eth0: OEM i82557/i82558 10/100 Ethernet, 00:03:47:B9:12:08, IRQ 11
  161.  
  162.     2.2 Module Selection
  163.  
  164. 3. Kernel Modules
  165.  
  166.     Raw (non-packaged kernel modules are available at:
  167.     http://trinux.sf.net/kernel/
  168.     
  169.     Packaged kernel modules are available at http://trinux.sf.net/pkg/2.4.x/ 
  170.     and may be installed with the "getkpkg <name>"
  171.  
  172.     Trinux puts all packages in /lib/modules or /usr/lib/modules instead
  173.     of the standard linux convention of /lib/modules/2.4.x/...
  174.  
  175. 4. Packages
  176.     
  177.     4.1 Package Format
  178.  
  179.         Packages are simply tarballs with an initialization script that
  180.         will be executed from within /etc/init.d/package_name or 
  181.         /etc/init.m/kernel_package_name
  182.  
  183.     4.2 Scripts
  184.     
  185.         * pkgadd  - loads a package from a local filesystem
  186.         * getpkg  - loads the package from the network
  187.         * getkpkg - loads a kernel package from the network
  188.         * pkglist - lists available packages
  189.         * rmpkg   - deletes package
  190.  
  191.     4.3 Building your own
  192.  
  193.         All the Trinux packages are compiled with glibc 2.1.3 using
  194.         Slackware 7.1. I upgraded the compiler to gcc 2.95 and have upgraded
  195.         libraries as necessary.
  196.  
  197.     4.4 Adding packages after bootup
  198.  
  199.         You can either use the getpkg/getkpkg commands to load a package
  200.         from the network
  201.  
  202. 5. Filesystems
  203.  
  204.     5.1 Supported Filesytems
  205.  
  206.         Trinux may only have support for a few filesystems such as minix
  207.         vfat (Windows) and ISO9660 (for CDROMs). To see which filesystems
  208.         are currently supported in the kernel:
  209.  
  210.         # cat /proc/filesystems | grep -v nodev
  211.                 minix
  212.                 vfat
  213.                 iso9660
  214.                 reiserfs
  215.  
  216.         In this case I installed the reiserfs module:
  217.  
  218.         # lsmod
  219.         reiserfs              165600   1
  220.         3c59x                  24560   1
  221.         8139too                13396   1
  222.         mii                     2092   0 [8139too]
  223.  
  224.  
  225.         To mount a device you use the following command:
  226.         
  227.             mount <device> -t <filesystem type> <mount point)
  228.         
  229.         So to mount the floppy you would 
  230.  
  231.         You can determine the which IDE devices are present by the following
  232.         command:
  233.  
  234.         # dmesg | grep hd
  235.         ide0: BM-DMA at 0x1850-0x1857, BIOS settings: hda:DMA, hdb:pio
  236.         ide1: BM-DMA at 0x1858-0x185f, BIOS settings: hdc:pio, hdd:pio
  237.         hda: IC25N040ATCS04-0, ATA DISK drive
  238.         hda: 78140160 sectors (40008 MB) w/1768KiB Cache, CHS=5168/240/63
  239.         hda: hda1 hda2 hda3 < hda5 hda6 > hda4
  240.         hde: LEXAR ATA FLASH, ATA DISK drive
  241.          hde: 96384 sectors (49 MB) w/1KiB Cache, CHS=753/4/32
  242.           hde: hde1
  243.  
  244.         So assuming hde1 were a vfat partition, you would use:
  245.  
  246.         # mount -t vfat /dev/hde1 /mnt
  247.         # mount
  248.         /dev/hda2 on / type ext3 (rw,errors=remount-ro)
  249.         proc on /proc type proc (rw)
  250.         devpts on /dev/pts type devpts (rw,gid=5,mode=620)
  251.         /dev/hda4 on /alt type reiserfs (rw)
  252.         /trinux/boot/trinux.img on /loop type vfat (rw,loop=/dev/loop0)
  253.         /dev/hde1 on /mnt type vfat (rw)
  254.  
  255.         This was from my laptop. Within Trinux, the following is more
  256.         typical:
  257.  
  258.         # mount
  259.         /dev/ram0 on / type minix (rw)
  260.         /proc on /proc type proc (rw)
  261.         /dev/null on /usr type tmpfs (rw)
  262.         /dev/null on /home type tmpfs (rw)
  263.         /dev/null on /var type tmpfs (rw)
  264.         /dev/hda2 on /hda2 type reiserfs (rw)
  265.  
  266.         
  267.     5.3 Swap
  268.  
  269.         Usually, you probably have enough memory (otherwise you wouldn't
  270.         be running ramdisks) but if you want to set up a swap file or swap
  271.         filesystem, put the name of the file (within an existing filesytem)
  272.         the name of the partition (/dev/hda3) in /etc/tux/config/swap and 
  273.         the linuxrc will automatically run mkswap and swapon. You may 
  274.         want to make sure the swaputils.tgz package is included, 
  275.         although it will be loaded automatically if /sbin/makeswap 
  276.         isn't found.
  277.  
  278.     5.4 Tmpfs
  279.  
  280.         A neat feature that came out in 2.4 was the ability to use the
  281.         temporary or shared memory filesystem instead of ramdisks. The key
  282.         advantage is that ramdisks are completed allocated when the are
  283.         created, but tmpfs partitions only use RAM as they are filled.
  284.  
  285.  
  286.         Trinux only has support for a minimal set of filesystems
  287.  
  288. 6. Management and Monitoring
  289.  
  290.         Although it is probably not the most common option, Trinux can be
  291.         used in a headless server capacity
  292.  
  293.     6.1 Serial Console
  294.  
  295.     6.2 SSH Remote Logins
  296.  
  297.     6.3 Enabling Cisco Discovery Protocol (CDP)
  298.  
  299.     6.4 Building a Local Package Server
  300.  
  301. 7. Miscellaneous
  302.  
  303.     6.1 Troubleshooting
  304.  
  305.         Recent versions of trinux have a /sbin/hwinfo script that gathers
  306.         hardware information about the system and saves it to the file
  307.         /tmp/hwinfo. It basically saves the output of the dmesg command
  308.         and copies the values of some /proc files that can be used to help
  309.         troubleshoot hardware problems. The following commands allow you to
  310.         save this file to the boot floppy (assuming you have enough room)
  311.         
  312.             # fmount
  313.             # cp /tmp/hwinfo /floppy
  314.             # fumount
  315.  
  316.         You can then post some or all of this file to the trinux-talk mailing
  317.         list when you have a problem.
  318.  
  319.     6.2 Where to get help
  320.  
  321.         You should subscribe to the trinux-talk mailing list
  322.